package com.itheima.inner7;

/*
 现有一个接口  有一个swim 方法

 在Test类有一个方法 goSwim 需要一个接口的子类对象
 main中使用goSwim 方法
 */
public class Test {

    public static void main(String[] args) {

        goSwim(new Swimming() {
            @Override
            public void swim() {

                System.out.println("咱们游泳吧");
            }
        });

        int compare = compare(new Comparable() {
            @Override
            public int compareTo(Object o) {
                Integer i=(Integer)o;
                int result=i;
                return i;
            }
        });
        System.out.println(compare);
        goSwim(()->{
            System.out.println("这个方法我可说清楚了哦");
        });

    }

    public static void  goSwim(Swimming swimming){

        swimming.swim();
    }

    public static int  compare(Comparable comparable){

        return comparable.compareTo(1000);
    }
}

interface  Swimming{
    int i=10;
    void swim();
}
